package com.ship.dispatch.mapper.bpm;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.dispatch.bean.bpm.BpmProcessDefinitionExtDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.Collection;
import java.util.List;

public interface BpmProcessDefinitionExtMapper extends BaseMapper<BpmProcessDefinitionExtDO> {

    default List<BpmProcessDefinitionExtDO> selectListByProcessDefinitionIds(Collection<String> processDefinitionIds) {
        return selectList(new LambdaQueryWrapper<BpmProcessDefinitionExtDO>().in(BpmProcessDefinitionExtDO::getProcessDefinitionId,processDefinitionIds));
    }

    default BpmProcessDefinitionExtDO selectByProcessDefinitionId(String processDefinitionId) {
        return selectOne(new LambdaQueryWrapper<BpmProcessDefinitionExtDO>().eq(BpmProcessDefinitionExtDO::getProcessDefinitionId,processDefinitionId));// selectOne("process_definition_id", processDefinitionId);
    }

}
